package sg.edu.nus.iss.billing.datastore;

import sg.edu.nus.iss.billing.exception.DataStoreException;

/**
 * For support simple transaction
 * @author Wang DaYong
 *
 */
public interface Transaction {

	/**
	 * Start transaction, if a transaction has started in same session, will cause DataStoreException
	 * @throws DataStoreException
	 */
	void startTransaction() throws DataStoreException;

	/**
	 * commit changes
	 * @throws DataStoreException
	 */
	void commit() throws DataStoreException;

	/**
	 * rollback transaction, this will rollback all changes
	 * @throws DataStoreException
	 */
	void rollback() throws DataStoreException;
}
